/**
 * Created by scenic on 2017/8/10.
 */
var MeshCreateUtils = {

    defaultWidth:100,
    defaultHeight:100,
    defaultDepth:100,
    createSpaceMesh: function () {


        var materials = [];
        for (var i = 0; i < 6; i++) {
            var material = new THREE.MeshLambertMaterial({
                transparent: true,
                opacity: 0.4,
                color: Math.random() * 0xffffff,
                depthTest: true
            });
            materials.push(material);
        }
        var mesh = new GSThree.Mesh(new THREE.BoxBufferGeometry(this.defaultWidth, this.defaultHeight, this.defaultDepth), materials);

        return mesh;

    },

    createDefaultPlank: function (imageUrl) {

        var texture = new THREE.TextureLoader().load(imageUrl);
        var materials = [
            new THREE.MeshLambertMaterial({color: Math.random() * 0xffffff, side: THREE.DoubleSide}),
            new THREE.MeshLambertMaterial({color: Math.random() * 0xffffff, side: THREE.DoubleSide}),
            new THREE.MeshStandardMaterial({color: 0xffffff, map: texture, side: THREE.DoubleSide}),
            new THREE.MeshStandardMaterial({color: 0xffffff, map: texture, side: THREE.DoubleSide}),
            new THREE.MeshLambertMaterial({color: Math.random() * 0xffffff, side: THREE.DoubleSide}),
            new THREE.MeshLambertMaterial({color: Math.random() * 0xffffff, side: THREE.DoubleSide}),
        ];

        var geometry = new THREE.BoxBufferGeometry(this.defaultWidth, this.defaultHeight, this.defaultDepth);

        var mesh = new GSThree.Mesh(geometry, materials);
        return mesh;

    }
}
export
{
    MeshCreateUtils
};